package org.pwwong.scalautils.collection.jcl

import scala.collection.jcl.BufferWrapper

object ListWrapper{
  def apply[A](_underlying : java.util.List[A]) = new ListWrapper[A](_underlying)
}

class ListWrapper[A](override val underlying : java.util.List[A]) extends BufferWrapper[A]  {
  override def clone: ListWrapper[A] = {
    val cloned = new java.util.ArrayList[A]
    this.foreach(cloned.add(_))
    new ListWrapper[A](cloned)
  }
}
